'use strict';

const Service = require('../core/common');

class BannersService extends Service {
  findAll(params = {}) {
    const { ctx } = this;

    return ctx.model.Banners.findAndCountAll(this.paging(params));
  }

  findById(id) {
    const ctx = this.ctx;

    return ctx.model.Banners.findById(id);
  }

  create(params = {}) {
    const { ctx } = this;

    return ctx.model.Banners.create(params);
  }

  update(params = {}, where = {}) {
    const { ctx } = this;

    console.log(params, where, '123321')

    return ctx.model.Banners.update(params, where);
  }

  destroy(params) {
    const { ctx } = this;

    return ctx.model.Banners.destroy(params);
  }
}

module.exports = BannersService;